//
//  ViewController.m
//  AutolayoutAnimation
//
//  Created by Puzhi Li on 15/6/18.
//  Copyright (c) 2015年 Puzhi Li. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UITextField *userNameTextField;
@property (weak, nonatomic) IBOutlet UITextField *userPwdTextField;
@property (weak, nonatomic) IBOutlet UILabel *userNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *userPwdLabel;

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)loginButtonClick:(id)sender
{
    self.userNameLabel.text = [NSString stringWithFormat:@"您输入的用户名是：%@", self.userNameTextField.text];
    self.userPwdLabel.text = [NSString stringWithFormat:@"您输入的密码是：%@", self.userPwdTextField.text];
}

#pragma mark - Touch event Handler
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesBegan:touches withEvent:event];
    
    [self.userNameTextField resignFirstResponder];
    [self.userPwdTextField resignFirstResponder];
}
@end
